# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpec do
  @moduledoc """
  A specification for configuring the behavior of content search.

  ## Attributes

  *   `chunkSpec` (*type:* `GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecChunkSpec.t`, *default:* `nil`) - Specifies the chunk spec to be returned from the search response. Only available if the SearchRequest.ContentSearchSpec.search_result_mode is set to CHUNKS
  *   `extractiveContentSpec` (*type:* `GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecExtractiveContentSpec.t`, *default:* `nil`) - If there is no extractive_content_spec provided, there will be no extractive answer in the search response.
  *   `searchResultMode` (*type:* `String.t`, *default:* `nil`) - Specifies the search result mode. If unspecified, the search result mode defaults to `DOCUMENTS`.
  *   `snippetSpec` (*type:* `GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecSnippetSpec.t`, *default:* `nil`) - If `snippetSpec` is not specified, snippets are not included in the search response.
  *   `summarySpec` (*type:* `GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecSummarySpec.t`, *default:* `nil`) - If `summarySpec` is not specified, summaries are not included in the search response.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :chunkSpec =>
            GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecChunkSpec.t()
            | nil,
          :extractiveContentSpec =>
            GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecExtractiveContentSpec.t()
            | nil,
          :searchResultMode => String.t() | nil,
          :snippetSpec =>
            GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecSnippetSpec.t()
            | nil,
          :summarySpec =>
            GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecSummarySpec.t()
            | nil
        }

  field(:chunkSpec,
    as:
      GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecChunkSpec
  )

  field(:extractiveContentSpec,
    as:
      GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecExtractiveContentSpec
  )

  field(:searchResultMode)

  field(:snippetSpec,
    as:
      GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecSnippetSpec
  )

  field(:summarySpec,
    as:
      GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpecSummarySpec
  )
end

defimpl Poison.Decoder,
  for:
    GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpec do
  def decode(value, options) do
    GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpec.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for:
    GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1alphaSearchRequestContentSearchSpec do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
